import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTextField;


public class FirstFormEx extends JFrame {

	private JPanel contentPane;
	private JTextField tfId;
	private JTextField tfPw;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					FirstFormEx frame = new FirstFormEx();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public FirstFormEx() {
		setTitle("JoinOn");
		setResizable(false);
		setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
		setBounds(100, 100, 385, 230);
		setLocationRelativeTo(null);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				JFrame j = (JFrame)e.getSource();
				int choice = JOptionPane.showConfirmDialog(null/*부모 창*/, "회원가입창을 닫으시겠어요?"/*모달창 내용*/,""/*모달창 타이틀바*/,JOptionPane.YES_NO_OPTION/*yes,no버튼만 yes,cancel,no버튼 등 선택 가능*/);
				if(choice == JOptionPane.YES_NO_OPTION){
					setDefaultCloseOperation(EXIT_ON_CLOSE);
				}
			}
		});
		
		JLabel lblNewLabel = new JLabel("아이디 :  ");
		lblNewLabel.setBounds(75, 52, 57, 15);
		contentPane.add(lblNewLabel);
		
		JLabel lblNewLabel_1 = new JLabel("비밀번호 : ");
		lblNewLabel_1.setBounds(75, 89, 64, 15);
		contentPane.add(lblNewLabel_1);
		
		tfId = new JTextField();
		tfId.setBounds(151, 49, 116, 21);
		contentPane.add(tfId);
		tfId.setColumns(10);
		
		tfPw = new JTextField();
		tfPw.setBounds(151, 86, 116, 21);
		contentPane.add(tfPw);
		tfPw.setColumns(10);
		
		JButton btnNewButton = new JButton("확인");
		btnNewButton.setBounds(279, 52, 64, 52);
		contentPane.add(btnNewButton);
		
		JLabel lblNewLabel_3 = new JLabel("아이디 찾기");
		lblNewLabel_3.setBounds(179, 127, 88, 15);
		contentPane.add(lblNewLabel_3);
		
		JLabel lblNewLabel_4 = new JLabel("비밀번호 찾기");
		lblNewLabel_4.setBounds(179, 152, 88, 15);
		contentPane.add(lblNewLabel_4);
		
		JLabel lblNewLabel_5 = new JLabel("비회원 로그인");
		lblNewLabel_5.setBounds(88, 152, 92, 15);
		contentPane.add(lblNewLabel_5);
		
		JLabel memJoin = new JLabel("회원 가입");
		memJoin.setBounds(88, 127, 57, 15);
		contentPane.add(memJoin);
		
		memJoin.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				MemberJoin frame = new MemberJoin();
				frame.setVisible(true);
			}
		});
	}
}
